package com.swt.gap.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 请填写说明
 *
 * @author sx
 * @date 2020/1/17 15:26
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum ConditionTypeEnum {
    /**
     *条件类型
     */
    /**
     * 11111
     */
    GREATER(1, "大于", 1, "数字"),
    EQUAL(2, "等于", 1, "数字"),
    LESS_THAN(3, "小于", 1, "数字"),
    LIKE(4, "包含", 2, "字符串"),
    NOT_LIKE(5, "不包含", 2, "字符串"),
    START_TIME(6, "起始时间", 3, "时间"),
    END_TIME(7, "截止时间", 3, "时间"),
    MAXIMUM(8, "最大", 1, "数字");


    private Integer code;
    private String name;
    private Integer dataTypeCode;
    private String dataTypeName;

    public static ConditionTypeEnum getByCode(Integer code) {
        ConditionTypeEnum returnVal = null;
        for (ConditionTypeEnum conditionTypeEnum : ConditionTypeEnum.values()) {
            if (conditionTypeEnum.getCode().equals(code)) {
                returnVal = conditionTypeEnum;
                break;
            }
        }
        return returnVal;
    }

}
